<?php

class ContactController extends Core_Controller_Action 
{
	public $menuType = 4;
	public $_contact;
	
	public function init() {
		$this->view->menuType = $this->menuType;
		$_contact = new Contact();
	}
	
	
	
	public function indexAction() {
		$Contact = new Contact();
		$item = $Contact->getItemMain()->getFirst();
		$this->view->item = $item;
		if($item != null)
		{
		$loc = explode(';',$item['city_loc']);
		
		$this->view->lx = $loc[0];
		$this->view->ly = $loc[1];	
		}
		
	}
	
	public function showAction() {
		
		$id = intval( $this->_request->getParam( 'id', 0 ) );
		$Contact = new Contact();
		$item = $Contact->getItem($id)->getFirst();
		$this->view->item = $item;
		$loc = explode(';',$item['city_loc']);
		$this->view->lx = $loc[0];
		$this->view->ly = $loc[1];
		
	}
}